package com.yang.testservlet;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/s01")
public class Servlet01 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        控制台打印
        resp.setHeader("content-type", "text/html;charset=utf-8");
        System.out.println("傻逼李湘东");
//        返回给客户端，响应一句话
        resp.getWriter().write("yes");
        resp.getWriter().write("哈哈哈哈哈");

    }
}
